import type { RouteRecordRaw } from "vue-router";
import UserLayout from "@/views/UserLayout.vue";
import UserLoginView from "@/views/UserLoginView.vue";
import UserRegisterView from "@/views/UserRegisterView.vue";
import HomeView from "@/views/HomeView.vue";
import ACCESS_ENUM from "@/access/accessEnum";
import MdViewVue from "@/views/MdView.vue";
import PictureUpLoadView from "@/views/PictureUpLoadView.vue";
import NoAuth from "@/views/NoAuth.vue";


export const routes: Array<RouteRecordRaw> = [
  {
    path: "/admin/Manage",
    name: "用户管理",
    component: UserLayout,
    meta: {
      access: ACCESS_ENUM.ADMIN
    }
  },
  {
    path: "/user/login",
    name: "用户登录",
    component: UserLoginView,
    meta: {
      hideInMenu: true,
    }
  },
  {
    path: "/noAuth",
    name: "无权限",
    component: NoAuth,
    meta: {
      hideInMenu: true,
    }
  },
  {
    path: "/user/register",
    name: "用户注册",
    component: UserRegisterView,
    meta: {
      hideInMenu: true,
    }
  },
  {
    path: "/admin",
    name: "管理页面",
    component: HomeView,
    meta: {
      access: ACCESS_ENUM.ADMIN,
    },
  },
  {
    path: "/markdown",
    name: "Markdown编辑器",
    component: MdViewVue
  },
  {
    path: "/picUpload",
    name: "图片上传",
    component: PictureUpLoadView
  },
  
];

/*
export const routes: Array<RouteRecordRaw> = [
    {
      path: "/user",
      name: "用户",
      component: UserLayout,
      children: [
        {
          path: "/user/login",
          name: "用户登录",
          component: UserLoginView,
        },
        {
          path: "/user/register",
          name: "用户注册",
          component: UserRegisterView,
        },
      ],
    },
  ]
  */